<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display" %>
<script language="JavaScript" src="<%= request.getContextPath() + "/js/calendar6.js" %>"></script>
<script src="<%=request.getContextPath()%>/js/displaytag.js" type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript">
function changeState()
{
        
        document.frmSearchFD.fd.style.visibility="visible";
}
</script>
<logic:messagesPresent message="true"> 
 <table title="Mensajes de aplicacion" align="center" >
  <tr>
    <td><html:messages id="msg" property="msgInfor" message="true">
      <table border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td bgcolor="#A8BDDD" class="titalert"></td>
         <td bgcolor="#A8BDDD" class="titalert" height="30"><bean:write name="msg"/></td>
       </tr>
      </table></html:messages> 
    </td>
  </tr>
 </table>
 
  <table title="Mensajes de aplicacion" align="center" >
  <tr>
    <td><html:messages id="msg" property="msgError" message="true">
      <table border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td bgcolor="#A8BDDD" class="titalert"></td>
         <td bgcolor="#A8BDDD" class="titalert" height="30"><bean:write name="msg"/></td>
       </tr>
      </table></html:messages> 
    </td>
  </tr>
 </table>
 
 <table title="Mensajes de aplicacion" align="center" >
  <tr>
    <td><html:messages id="msg" property="msgWarn" message="true">
      <table border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td bgcolor="#A8BDDD" class="titalert"></td>
         <td bgcolor="#A8BDDD" class="titalert" height="30"><bean:write name="msg"/></td>
       </tr>
      </table></html:messages> 
    </td>
  </tr>
 </table>
 
 <table title="Mensajes de aplicacion" align="center" >
  <tr>
    <td><html:messages id="msg" property="msgOk" message="true">
      <table border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td bgcolor="#A8BDDD" class="titalert"></td>
         <td bgcolor="#A8BDDD" class="titalert" height="30"><bean:write name="msg"/></td>
       </tr>
      </table></html:messages> 
    </td>
  </tr>
 </table>
</logic:messagesPresent> 
 
<table width="99%"  border="0" cellpadding="0" cellspacing="0" widtd="100%">
 
  <tr> 
    <td height="25" colspan="12" align="center" class="titulosenblanco"><strong> CRITERIOS DE BUSQUEDA DE FONDOS DOCUMENTALES</strong></td>
  </tr>
  
  <tr align="left"> 
    <td height="25" colspan="12" class="titulosenblanco">
     <table width="4" border="0" cellpadding="0" cellspacing="0">
		  <tr> 
		     <td align="right" width="4"></td>
		  </tr>
		  <tr> 
            <td width="4">&nbsp;</td>
         </tr>  
     </table>
    </td>		
  </tr>

  
  
  
  
  <tr align="left">
    <td width="100%" align="center"> 
      <html:form action="admin/searchInvDetFD.do" name="frmSearchFD1" type="com.cs.paoyer.administration.web.form.FDForm">     
       <input type="hidden" name="warehouse" value="warehouse"/>
		   <table border="0" width="100%" id="table1">
			<tr>
			   <logic:present name="FDList">
			   		<td width="100%">
			   </logic:present>
			   <logic:notPresent name="FDList">
			   		<td width="397">
			   </logic:notPresent>

  
				<table border="0" width="92%" id="table2">
					<tr>
						<td> 
    
       					<strong>Sucursal</strong> 
            (*)&nbsp;&nbsp;</td>
						<td><logic:present name="selectedBranch">
          <html:select styleClass="form" property="branchId" style="width:215" onchange="submit()" > 
            	<option value = '<bean:write name="selectedBranch" property="branchInternalCode" />'><bean:write name="selectedBranch" property="branchName" /></option>
            	<html:options collection="branches" property="branchInternalCode" labelProperty="branchName"/> 
            </html:select> 
          </logic:present>
          <logic:notPresent name="selectedBranch">
		  	    <html:select styleClass="form" property="branchId" style="width:215" onchange="submit()" > 
            	<html:option value = "" >Seleccionar sucursal</html:option>
            	<html:options collection="branches" property="branchInternalCode" labelProperty="branchName"/> 
            </html:select> 
            </logic:notPresent></td>
					</tr>
					</html:form>
           <logic:present name="actualRequest">
            <html:form action="admin/searchInvDetFD.do" name="frmSearchFD" type="com.cs.paoyer.administration.web.form.FDForm">     
					<tr>
						<td><strong>Contrato</strong> 
            (*)&nbsp;&nbsp;</td>
						<td><html:select styleClass="form" property="contract" style="width:215" > 
            		<html:option value = "" >Seleccionar contrato</html:option>
            		<html:options collection="contracts" property="parallelCode" labelProperty="parallelCode" /> 
            	</html:select></td>
					</tr>
					<tr>
						<td><strong>Bodega</strong> 
            (*)&nbsp;&nbsp;</td>
						<td><html:select styleClass="form" property="warehouseId" style="width:215" > 
            		<html:option value = "" >Seleccionar Bodega</html:option>
            		<html:options collection="warehouses" property="warehouseInternalCode" labelProperty="warehouseName" /> 
            	</html:select></td>
					</tr>
					<tr>
						<td><strong>Centro de costo</strong> 
            			(*)</td>
						<td><html:select styleClass="form" property="costCenterId" style="width:215" > 
            		<html:option value = "" >Seleccionar Centro de Costo</html:option>
            		<html:options collection="centers" property="costCenterInternalCode" labelProperty="costCenterName" /> 
            	</html:select></td>
					</tr>
				</table>
				</td>
				<td>
				<table border="0" width="97%" id="table3">
					<tr>
						<td> 
    
       					<strong>FD</strong> 
            (*)&nbsp;&nbsp;</td>
						<td width="282">		    <select name="fdType" class="form" onchange="changeState()" >
							    <option value="">Seleccionar tipo</option>
                  <option value="0">Numero de FD</option>
									<option value="1">Codigo interno</option>
						</select>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <input name="fd" type="text" size="15" class="form" style="visibility:hidden">
             </td>
					</tr>
				</table>
				</td>
				<td width="435">
				<table border="0" width="79%" id="table4">
					<tr>
						<td> 
      
       					<strong>Clase de FD</strong> (*)</td>
						<td><html:select styleClass="form" property="fdClassId" style="width:215" > 
            		<html:option value = "" >Seleccionar Clase de FD</html:option>
            		<html:option value = "1" >Caja</html:option>
                <html:option value = "2" >Medios Magneticos</html:option>
                <html:option value = "4" >Unidad documental</html:option>
                <html:option value = "6" >Folio</html:option>
                <html:option value = "7" >Contenedor</html:option>
                <html:option value = "9" >Precintos</html:option>
            	</html:select></td>
					</tr>
					<tr>
						<td><strong>Tipo de FD</strong> 
            			(*)</td>
						<td><html:select styleClass="form" property="fdClassId" style="width:215" > 
            		<html:option value = "" >Seleccionar tipo de FD</html:option>
            		<html:option value = "2" >X300</html:option>
                <html:option value = "3" >X400</html:option>
                <html:option value = "4" >X200</html:option>
            	</html:select></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		   <table width="85%" border="0" cellpadding="3" cellspacing="3">    
        <tr> 
          <td width="7%">&nbsp;</td>
          <td width="14%" align="left" class="celdatabla">&nbsp;</td>
          <td width="25%">
          
          </td>
          <td width="10%">&nbsp;</td>
          <td width="16%">
					
			
			
			</td>
          <td width="11%">&nbsp;</td>
          <td width="15%">
			<p align="right"> <input type="submit" name="Submit" value="Buscar"></td>
        </tr>
        </table>
			
      <input type="hidden" name="initial" value="initial" />
      <input type="hidden" name="branchId" value='<bean:write name="actualRequest" property="branchId" />' />
      </td>
  </tr>
  
</html:form> 	
</logic:present>
  

  
  
  <tr align="left"> 
    <td height="25" colspan="2">
     
    </td>
  </tr>
  
  <tr bgcolor="#00309C"> 
    <td colspan="12" bgcolor="#FFFFFF" width="100%">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="20"><div align="left"></div></td>
            <td width="100%" bgcolor="#000066"></td>
            <td width="20"><div align="right"></div></td>
          </tr>
        </table>
      </td>
  </tr>
  
  <tr> 
    <td width="100%" colspan="12" align="left">
	 
		
		
	<logic:present name="FDList"> 
	<%int index = 1;
	  String style = "add";%>
      <display:table name="requestScope.FDList"  pagesize="20"    id="fds"  cellpadding="3" cellspacing="1"  style="width:100%">
			
			<display:column  headerClass="headerTable" class="Numero" title="Contrato" sortable="true">
					<div align="center"><bean:write name="fds" property="contract" /> </div>
			</display:column>	
			
			<display:column headerClass="headerTable" title="Clase de FD" class="Numero" sortable="true">
			        
                   <bean:write name="fds" property="fdClassName" /> 
              
			</display:column>	
			<display:column headerClass="headerTable" title="Tipo de FD" class="Numero" sortable="true">
			         <bean:write name="fds" property="fdTypeName" /> 	
			</display:column>		
			
			<display:column headerClass="headerTable" title="Num. FD" class="Numero" sortable="true">
						<bean:write name="fds" property="fd" /> 
		    </display:column>											
			<display:column headerClass="headerTable" title="Ubicacion FD" class="Numero" sortable="true">
						<bean:write name="fds" property="location" /> 
		    </display:column>
			<display:column headerClass="headerTable" title="Codigo interno Cliente" class="Numero" sortable="true">
						<bean:write name="fds" property="clientICode" /> 
		    </display:column>
			<display:column headerClass="headerTable" title="Tamano" class="Numero" sortable="true">
						<bean:write name="fds" property="size" /> 
		    </display:column>
			<display:column headerClass="headerTable" title="Fecha Ingreso FD" class="Numero" sortable="true">
						<bean:write name="fds" property="entranceDate" /> 
		    </display:column>
		</display:table>
		</logic:present>
		</td>
  </tr>
  
  <tr> 
    <td colspan="12" bgcolor="#00309C"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="20" bgcolor="#FFFFFF"><div align="left"><img src="<%= request.getContextPath() + "/images/inf_izq_inf.gif" %>" width="8" height="8"></div></td>
          <td width="100%" bgcolor="#000066"></td>
          <td width="20" bgcolor="#FFFFFF"><div align="right"><img src="<%= request.getContextPath() + "/images/inf_der_inf.gif" %>" width="8" height="8"></div></td>
        </tr>
      </table></td>
  </tr>
</table>